from application.enumeration.ContentTypeEnum import ContentTypeEnum
from tortoise.fields import CharEnumField, BigIntField
from application.model import TortoiseBaseModel


class LikeModel(TortoiseBaseModel):
    """
    用户点赞/喜欢表
    """
    user_id: int = BigIntField(null=False, description="用户ID")
    target_id: int = BigIntField(null=False, description="目标ID")
    content_type: str = CharEnumField(enum_type=ContentTypeEnum, max_length=5, null=True,
                                      description="点赞/喜欢的内容类型，帖子等等")

    class Meta:
        table: str = "like"  # 表名
        table_description: str = "用户点赞/喜欢表"  # 表描述
